<?php

if(!defined('IN_DISCUZ') || !defined('IN_ADMINCP')) {
	exit('Access Denied');
}

$fromversion = $_GET['fromversion'];

if($fromversion < 1.2) {
    $config = DB::table('er_sign_in_config');

    $configs = [
        ['extcredits', '积分类型', '2', '使用的积分类型'],
        ['credit', '签到金币积分区间', '["1","30"]', '签到时随机取值'],
        ['position', '电脑端显示位置', 'usernav_extra3', ''],
        ['mobile_position', '手机端显示位置', 'index_find_extra_mobile', ''],
        ['position_float_value', '浮动定位', '["92","35"]', '按页面百分比决定位置'],
        ['position_float_color', '浮动颜色', '#ffffff', '浮动文字颜色'],
        ['position_float_bgcolor', '浮动背景颜色', '#000000', '浮动背景颜色']
    ];
    
    foreach($configs as $item) {
        if(!DB::fetch_first("SELECT * FROM {$config} WHERE `key`='{$item[0]}'")) {
            runquery("INSERT INTO {$config} (`key`, name, value, `desc`) 
                     VALUES ('{$item[0]}', '{$item[1]}', '{$item[2]}', '{$item[3]}')");
        }
    }
}

$finish = TRUE;